package com.bulk.url;

import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

/**
 * @author 散装java
 * @date 2022-11-23
 */
public class UrlTest {
    private static final List<String> ANALYZE_URL_PREFIX_LIST = Arrays.asList("http://tuniu.cc/t", "https://tuniu.cc/t");

    public static void main(String[] args) {
        HashMap<String, Object> params1 = new HashMap<>(1);
        params1.put("encryptedData", "BlSwhgkeazrFzuAQ2PbtH7JIa7kTIIg/dRYIrkkCEZk=");
        String resultStr = HttpUtil.post("https://api.tuniu.com/basis/weixin/getDecodeValue", params1, 2000);
        System.out.println(resultStr);
        String url = "H:t=预售###http://tuniu.cc/t/Gl5vSb?addQwChannel=sxd";
        if (!StrUtil.containsAny(url, ANALYZE_URL_PREFIX_LIST.toArray(new String[0]))) {
            System.out.println("不包含");
        } else {
            System.out.println("包含");
        }

        if (StrUtil.contains(url, "H:t=") && StrUtil.contains(url, "###")) {
            System.out.println("sss");
        }
        HashMap<String, Object> params = new HashMap<>(1);
        params.put("encryptedData", "BlSwhgkeazrFzuAQ2PbtH7JIa7kTIIg/dRYIrkkCEZk=");
        String getUrl = "https://api.tuniu.com/basis/weixin/getDecodeValue";
        final String s = HttpUtil.post(getUrl,params);
        System.out.println(s);

    }

}
